package dailytools.dailyui.controller;

import dailytools.dailyui.core.DefaultUIController;
import dailytools.dailyui.core.UIController;
import dailytools.dailyui.core.StageManager;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.input.InputMethodEvent;
import javafx.scene.web.HTMLEditor;
import javafx.scene.web.WebView;

import java.net.URL;
import java.util.ResourceBundle;

public class MainController  extends DefaultUIController implements Initializable {

    @FXML
    private Button button1;
    @FXML
    private Button button2;
    @FXML
    private Button button3;
    @FXML
    private Button button4;
    @FXML
    private Button load;

    @FXML
    private HTMLEditor htmlEditor1;
    @FXML
    private WebView webView1;

    @Override
    @FXML
    public void initialize(URL location, ResourceBundle resources) {

    }

    @FXML
    public void onClick(javafx.event.ActionEvent actionEvent) {
    }

    public void onInputChanged(InputMethodEvent inputMethodEvent) {
        System.out.println(htmlEditor1.getHtmlText());
    }

    public void doLoad(ActionEvent actionEvent) {
        webView1.getEngine().load("https://coderslegacy.com/java/switch-between-scenes-in-javafx/");
    }

    public void goPage1(ActionEvent actionEvent) {
        stageManager.setScene(MainController.class);
    }
    public void goPage2(ActionEvent actionEvent) {
        stageManager.setScene(EditorController.class);
    }
    public void goPage3(ActionEvent actionEvent) {
        stageManager.setScene(ViewerController.class);
    }
}
